import request from '#/utils/requestAbort.js';
import type {
  IPostQueryPriceDiffCurveParamsType,
  IPostQueryForecastAndSimulateParamsType,
  IFormValue,
  IPostQueryShortForecastCurveAdjustmentParamsType,
  IPostFindOperationLogParamsType,
  IPostFindStrategyPriceForecastParamsType,
  IPostFindAIRateDataParamsType,
  IPostFindQuoteStationDataParamsType,
  IPostQueryAllIssuePlanListParamsType,
} from './type';

// 查询价差曲线-历史预测
export async function postQueryPriceDiffCurve(params: IPostQueryPriceDiffCurveParamsType) {
  return request('/distribution/powerForeAdjustItera/queryPriceDiffCurve', {
    method: 'POST',
    data: params,
  });
}

// 查询价差曲线-天机预测
export async function postGetSpotPriceDifferencePriceForecast(
  params: IPostQueryPriceDiffCurveParamsType,
) {
  return request('/distribution/clearingPriceForecast/findSpotPriceDifferencePriceForecast', {
    method: 'POST',
    data: params,
  });
}

// 功率预测及模拟调整
/* export async function postQueryForecastAndSimulate(
  params: IPostQueryForecastAndSimulateParamsType,
) {
  return request('/distribution/powerForeAdjustItera/queryForecastAndSimulate', {
    method: 'POST',
    data: params,
  });
} */

export async function postQueryForecastAndSimulate(
  params: IPostQueryForecastAndSimulateParamsType,
) {
  return request('/distribution/powerForeAdjustItera/queryForecastAndAdjustmentResults', {
    method: 'POST',
    data: params,
  });
}

// 调整策略编辑列表数据
export async function postQueryRateData(params: IFormValue) {
  return request('/distribution/powerForeAdjustItera/queryRateData', {
    method: 'POST',
    data: params,
  });
}

// 查询AI推荐策略
export async function postFindAIRateData(params: IPostFindAIRateDataParamsType) {
  return request('/distribution/powerForeAdjustItera/findAIRateData', {
    method: 'POST',
    data: params,
  });
}

// 查询引用结算单元集合
export async function postFindQuoteStationData(params: IPostFindQuoteStationDataParamsType) {
  return request('/distribution/powerForeAdjustItera/findQuoteStationData', {
    method: 'POST',
    data: params,
  });
}

// 保存调整比例数据
export async function postAdjustProportionData(params: IPostQueryForecastAndSimulateParamsType) {
  return request('/distribution/powerForeAdjustItera/adjustProportionData', {
    method: 'POST',
    data: params,
  });
}

// 查询策略效益预估-当前策略
export async function postFindStrategyPriceForecast(
  params: IPostFindStrategyPriceForecastParamsType,
) {
  return request('/forecast/powerForeAdjustItera/findStrategyPriceForecast', {
    method: 'POST',
    data: params,
  });
}

// 查询策略效益预估-AI策略
export async function postFindStrategyPriceForecastAI(
  params: IPostFindStrategyPriceForecastParamsType,
) {
  return request('/forecast/powerForeAdjustItera/findStrategyPriceForecastAI', {
    method: 'POST',
    data: params,
  });
}

// 查询操作日志
export async function postFindOperationLog(params: IPostFindOperationLogParamsType) {
  return request('/distribution/powerForeAdjustItera/findOperationLog', {
    method: 'POST',
    data: params,
  });
}

// 查询申报计划列表
export async function postQueryIssuePlanList(params: IFormValue) {
  return request('/distribution/powerForeAdjustItera/queryIssuePlanList', {
    method: 'POST',
    data: params,
  });
}

// 查询申报详情数据
export async function postQueryShortForecastCurveAdjustment(
  params: IPostQueryShortForecastCurveAdjustmentParamsType,
) {
  return request('/distribution/powerForeAdjustItera/shortForecastCurveAdjustment', {
    method: 'POST',
    data: params,
  });
}

// 查询执行总览列表
export async function postQueryAllIssuePlanList(params: IPostQueryAllIssuePlanListParamsType) {
  return request('/distribution/powerForeAdjustItera/queryAllIssuePlanList', {
    method: 'POST',
    data: params,
  });
}

// 查询执行总览列表(新接口)
export async function postNewQueryAllIssuePlanList(params: IPostQueryAllIssuePlanListParamsType) {
  return request('/private-business/powerForeAdjustItera/queryAllIssuePlanList', {
    method: 'POST',
    data: params,
  });
}

// 查询交易单元关联的所有数据源
export async function postQueryDataSourceList(params: { stationList?: string[] }) {
  return request('/distribution/powerForeAdjustItera/queryDataSourceList', {
    method: 'POST',
    data: params,
  });
}

// 查询交易单元关联的所有数据源(新接口)
export async function postNewQueryDataSourceList(params: { stationList?: string[] }) {
  return request('/private-business/powerForeAdjustItera/queryDataSourceList', {
    method: 'POST',
    data: params,
  });
}

// // 记录上次引用的交易单元
// export async function postSaveLastQuoteStation(params: { stationId?: string | number }) {
//   return request('/forecast/powerForeAdjustItera/saveLastQuoteStation', {
//     method: 'POST',
//     data: params,
//   });
// }

// 查询上次引用的交易单元
export async function postQueryLastQuoteStation(params?: any) {
  return request('/distribution/powerForeAdjustItera/queryLastQuoteStation', {
    method: 'POST',
    data: params,
  });
}

export async function postAiStrategySwitch(params?: any) {
  return request('/distribution/regularDistribution/aiStrategySwitch', {
    method: 'POST',
    data: params,
  });
}
// AI策略算法列表
export async function getAiTacticsByStationIdAndMarkDate(params?: any) {
  return request('/distribution/powerForeAdjustItera/getAiTacticsByStationIdAndMarkDate', {
    method: 'POST',
    data: params,
  });
}
// AI策略图表数据
export async function queryForecastAndAiTactics(params?: any) {
  return request('/distribution/powerForeAdjustItera/queryForecastAndAiTactics', {
    method: 'POST',
    data: params,
  });
}

//人工策略AI策略启用数据
export async function enableAI(params?: any) {
  return request('/distribution/powerForeAdjustItera/enableAi', {
    method: 'POST',
    data: params,
  });
}

//人工策略图表数据
export async function queryForecastAndManualStrategy(params?: any) {
  return request('/distribution/powerForeAdjustItera/queryForecastAndManualStrategy', {
    method: 'POST',
    data: params,
  });
}

//人工策略按钮历史记录
export async function manualStrategySaveDataStatus(params?: any) {
  return request('/distribution/powerForeAdjustItera/manualStrategySaveDataStatus', {
    method: 'POST',
    data: params,
  });
}

// AI策略默认启用状态
export async function postShowAiStrategy(params?: any) {
  return request(`/distribution/regularDistribution/showAiStrategy/${params}`, {
    method: 'GET',
  });
}
// 省份-交易中心-场站（数据权限）
export async function queryMarketList(menuCode?: string) {
  return request(`/power/dataPower/common/${menuCode}/t_station`, {
    method: 'GET',
  });
}

//报量报价 保存
export async function saveProvincialSpotBiddingPlan(data: any) {
  return request(`/distribution/powerForeAdjustItera/saveProvincialSpotBiddingPlan`, {
    method: 'POST',
    data,
  });
}

//报量报价 查询
export async function queryProvincialSpotBiddingPlan(data: any) {
  return request(`/distribution/powerForeAdjustItera/queryProvincialSpotBiddingPlan `, {
    method: 'POST',
    data,
  });
}

//价格上下限配置
export async function provincialSpotBiddingPlanPriceLimitConfig(data: any) {
  return request(`/distribution/powerForeAdjustItera/provincialSpotBiddingPlanPriceLimitConfig`, {
    method: 'POST',
    data,
  });
}

//操作日志
export async function queryProvincialSpotBiddingLog(data: any) {
  return request(`/distribution/powerForeAdjustItera/queryProvincialSpotBiddingLog`, {
    method: 'POST',
    data,
  });
}

// 山西
